<?php
if (!defined('CMS_SYSTEM')) die();
if ($disable_site) {
	echo "<center style=\"margin-top:200px;font-weight:bold\">".$disable_message ."</center>";
}else{
global $db,$Default_Temp, $time, $currentlang,$prefix;
//Ket thuc phan insert du lieu
include_once("templates/".$Default_Temp."/header.php");
  include_once("templates/".$Default_Temp."/banner.php");
  include_once("templates/".$Default_Temp."/menu.php");
     /*
		   * Phan loc ra tat ca san pham
		   * Le duc vien
		   */
		 echo "<div id=\"wrapper\">";
			 echo "<div class=\"content fix\">";
			     //Noi dung phan loc he thong phan phoi
			     echo "<div class=\"w720 fl\">";
			       echo "<div class=\"common\">";
			            echo "<div class=\"title\">";
						 echo "<h1 class=\"text\"><a href=\"".url_sid("index.php?f=allocated")."\"><span>"._ALLOCATED."</a></h1>";
			    		echo "</div>";
					    echo "<div class=\"wrap fix\">";
					          echo "<div class=\"detail\">";
								 echo "<div class=\"info\">";
								 list($imges) = $db->sql_fetchrow($db->sql_query("SELECT images FROM ".$prefix."_gentext WHERE textname='allocated' AND alanguage='$currentlang'"));
								 $bnext = Common::getExt($imges);
                                 if($bnext == "swf") {
									 echo "<embed width=\"300\" height=\"443\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" wmode=\"transparent\" allowfullscreen=\"false\" scale=\"noborder\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" quality=\"high\" src=\"$path_upload/temp/$imges\" />";
                                 }else{
                                 	 echo "<img src=\"$path_upload/temp/$imges\" width=\"300\" height=\"443\"/>";
                                 }
								 echo "</div>";
								 echo "<div class=\"clear\"></div>";
								 $result = $db->sql_query("SELECT id, region, address, phone,email,website,times,if_show FROM ".$prefix."_allocated WHERE alanguage='$currentlang' AND if_show=1 ORDER BY times DESC");
								 if($db->sql_numrows($result) > 0) {
								 	$i=1;
								 	while(list($id, $region, $address, $phone,$email,$website,$times,$if_show) = $db->sql_fetchrow($result)) {
								 	if($i%2 == 0)
								 	{
								 		$class="office ml20";
								 	}else {
								 		$class="office";
								 	}
									 echo "<div class=\"$class\">";
										 echo "<div class=\"region\"><span>$region</span></div>";
										 echo "<div class=\"location\">";
											 echo "<ul>";
												 echo "<li><b>"._SYSTEM_ADDRESS.": </b>$address</li>";
												 echo "<li><b>"._SYSTEM_PHONE.": </b>$phone</li>";
												 echo "<li><b>"._SYSTEM_EMAIL.": </b><a href=\"$email\">$email</a></li>";											
												 echo "<li><b>"._SYSTEM_WEBSITE.": </b><a href=\"$website\">$website</a></li>";									
											 echo "</ul>";
										 echo "</div>";
									 echo "</div>";
									 $i++;
								 	}
								 }else{
								 	echo "<center>"._SYSTEM_INFO."</center>";
								 }
								 echo "<div class=\"clear\"></div>";
							 echo "</div>";
					    echo "</div>";
			       echo "</div>";
			     echo "</div>";
			     include_once("templates/".$Default_Temp."/rightbody.php");
			 echo "</div>";
			 themeSlideShow(8);
			 themeFooter();
		 echo "</div>";
		 /*
		  * Ket thuc phan san pham
		  * 
		  */
}
?>